package com.example.threadcode.higherLeverFour.ID.v1;

class ID
{
//没用使用原子变量,手动加锁 影响性能.
   private static volatile long nextID = 1;

   static synchronized long getNextID()
   {
      return nextID++;
   }
}